from django.db import models

# Create your models here.

class BookInfo(models.Model):
    name = models.CharField(max_length=64, null=True, verbose_name='书名')
    author = models.CharField(max_length=128, null=True, blank=True, verbose_name='作者')
    publisher = models.CharField(max_length=128, null=True, blank=True, verbose_name='出版社')
    publication_date = models.DateField(null=True, blank=True, verbose_name='出版日期')
    isbn = models.CharField(max_length=13, unique=True, null=True, blank=True, verbose_name='ISBN编号')
    description = models.TextField(null=True, blank=True, verbose_name='书籍简介')
    def __str__(self):
        return self.name

    class Meta:
        verbose_name = '书籍信息'
        verbose_name_plural = verbose_name